-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Ensure docs gen inserts at correct place in file #18250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found.
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
|
coming_tag_index = release_notes.find_index {|line| line.match(/^## #{current_release} \[logstash-#{current_release}-release-notes\]$/) } | ||
coming_tag_index += 1 if coming_tag_index | ||
release_notes_entry_index = coming_tag_index || release_notes.find_index {|line| line.match(/\[logstash-\d+-release-notes\]$/) } | ||
release_notes_entry_index = coming_tag_index || release_notes.find_index {|line| line.match(/^## .*\[logstash-.*-release-notes\]$/) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a "fallback" when the current version does not have an entry yet (IE no coming_tag_index
). I quote "fallback" because this is actually the most likely case given our workflows. See below for irb
session showing the bug and the fix
irb(main):025:0> release_notes.find_index {|line| line.match(/\[logstash-\d+-release-notes\]$/) }
=> 291
irb(main):030:0> release_notes.find_index {|line| line.match(/^## .*\[logstash-.*-release-notes\]$/) }
=> 23
💛 Build succeeded, but was flaky
Failed CI Steps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Mergifyio backport 8.18 8.19 9.0 9.1 9.2 |
✅ Backports have been created
|
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2) # Conflicts: # tools/release/generate_release_notes_md.rb
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2)
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2) # Conflicts: # tools/release/generate_release_notes_md.rb
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2)
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2)
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2) Co-authored-by: Cas Donoghue <[email protected]>
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2) Co-authored-by: Cas Donoghue <[email protected]>
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2) Co-authored-by: Cas Donoghue <[email protected]>
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found.
Closes #17952